You are here: Statements and Functions > Wait
Syntax samples
WAIT <time expression>
WAIT 3 min
WAIT 0
WAIT 2.5 + CleanupTime
WAIT N(8,.5) + 3 sec
Simulates the time it takes to process an entity. WAIT delays further processing of the entity until the specified time has elapsed. The rest of the model continues to process while an entity waits. If the expression evaluates to zero, the current entity will not finish processing until all other processes scheduled for that moment in the simulation have finished.
Please note
You may use the "^" symbol in place of a "WAIT" statement.
Location processing, downtime, and move logic. Independent subroutines may also use WAIT statements which function as timers. (For more information about Independent subroutines, see Subroutines.)
Components
<time expression>
The length of the WAIT. This expression is evaluated whenever the statement is encountered. If no time unit is specified, the default time unit specified in the General Information Dialog is applied.
Example
In the following example, customers arrive at a fast-food restaurant and place their orders at location Counter. How long customers wait depends on the type of meal ordered. If they order meal one, two, or three, they wait only 2 minutes. Otherwise they wait 5 minutes.The example below shows WAIT statements used in an IF...THEN...ELSE expression. If the value of EntA’s attribute, Attr1, is greater than zero, the time delay is 5.0 minutes. Otherwise the delay is 2.5 minutes.
Process Table
Entity |
Location |
Operation (min) |
---|---|---|
EntA |
Loc1 |
IF Attr1>0 THEN WAIT 5 min ELSE WAIT 2.5 min |
Routing Table
Blk |
Output |
Destination |
Rule |
Move Logic |
---|---|---|---|---|
1 |
EntA |
Loc2 |
FIRST 1 |
MOVE FOR 10 |
WAIT UNTIL can stop additional processing until a condition is true.